// 返回类型
function type (target) {
    var ret = typeof(target);
    var template = {
        "[object Array]" : "array",
        "[object Object]" : "object",
        "[object Number]" : 'number - object',
        "[object Boolean]" : "boolean - object",
        "[object String]" : "string - object"
    }
    if(target === null) {
        return "null";
    } else if(ret =="object") {
        return template[ret];
    } else {
        return ret
    }
}

// 数组去重 原型链

Array.prototype.unique = function () {
    var temp = {},
        newArr = [],
        len = this.length;
    for(var i = 0; i < len; i ++ ){
        if(!temp[this[i]]){
            temp[this[i]] = 'A';
            newArr.push(this[i])
        }
    }
    return newArr
}